-
Notifications
You must be signed in to change notification settings - Fork 137
Conversation
…or panic on revert
…code, add support for sbundles, expose CLI flag and environment variable to enable multi-tx-snapshots
…nd line flag (#84) Co-authored-by: Vazha <[email protected]>
…uilder flag list, update log level for multi-tx-snap error
45913da
to
b04fd4b
Compare
1 active snapshot at a time is not enough for some of the uses that we will have. For example, there is a case with nested bundles where you can have optional bundle there. Other example could be allowing optional txs inside bundle to be thrown out on revert (instead of commiting them as reverted). Even though we decided on "if optional tx reverts we keep it reverted" but it may be the case that we change our opinion to "if optional tx reverts we discard it". This may become important when we merge bundles. API can look something like that.
|
) | ||
|
||
for _, tx := range bundle.OriginalBundle.Txs { | ||
if hasBaseFee && tx.Type() == types.DynamicFeeTxType { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I hate this part of our bundle commit code. I've added this to the first version of our builder as an inheritance from other code that worked with bundles but this is just out of place tbh. This is out of scope for this pr. We can probably do that in separate one.
Normally, for transactions these checks are done in txpool so when tx is in the miner
its already sanity checked. But for some reason we do that for bundles here instead of doing that in txpool.
I did this for sbundles, they are validated in txpool. I think we should do the same thing for bundles and make code for them smaller.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I've added TODO to move this to txpool, it makes sense to move the logic there and would help make this loop more compact while putting validation logic in one place
@@ -0,0 +1,417 @@ | |||
package miner |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think this code looks better than before.
…tx, pass gas limit for test setup, add abigen bindings and abi for compiled state fuzz test smart contract
…ng to the journal (#102)
…factor required to handle more dynamic configurations.
affcf6a
to
f2c5320
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'll approve because I cant' check all the details:
Two things that I would suggest to check:
- that transient storage will work with efficient reverts when they are implemented. do we need to clean them from the statedb / object structure (like we clean dirty storage)
- make sure that sbundle with backruns work. We have tests for them in the repo (they test envdiff implemenation).
Done |
📝 Summary
"Efficient revert feature" is an optimization that reduces burden on Ethereum state database and enables efficient way to track and revert state changes across multiple transactions
Add support for efficient reverts using multi-transaction snapshots, which reduce the amount of state copying on bundle reverts
Expose CLI flag and environment variable to toggle multi-transaction snapshots on greedy and greedy-buckets builder algorithms
Fix unit test errors when multi-tx-snapshot is enabled
This work builds on top of and heavily relies on excellent work by @dvush
Sample graph showing latency difference between efficient revert (multi-tx-snapshot) enabled vs baseline disabled
📚 References
CONTRIBUTING.md